FME Introduction - Session 9

 Transformers for Working with List Attributes

There are many transformers that we can use to manipulate lists: see the Lists category in FME Workbench transformer gallery.


What are List Attributes in FME?

List attributes are FME's way of allowing multiple values per attribute. For example, rather than creating a text field named FRUITS that stores the value “Apple, Orange, Pear”, a user can create a list, which is more structured and can be broken down into constituent parts for processing:

Fruits{0}: Apple 
Fruits{1}: Orange 
Fruits{2}: Pear 

In FME, lists are denoted using curly brackets after the list name (e.g. this list is called "Fruits{}"), and a number inside the curly brackets represents the element's index inside the list (e.g. Orange is element 1 in the list). With this structure, lists can be reorganized, exploded into individual parts, analyzed statistically, and more.

In FME, lists can be built manually, created automatically by a transformer, read and written by some formats (e.g. XML and JSON), or "exploded" back into single-value attributes. FME has 15 transformers for list manipulation and over 80 transformers can produce lists. Transformers often create a list when attributes from different features are grouped into a single feature. Transformers that create lists usually have a "Generate List" checkbox under the "Attribute Accumulation" section of their parameters dialog:

generate list.png

The Fruits{} list above is an example of a simple list. Complex lists can be created by adding attributes to each element. For example, we can add attributes for "name" and "scientificName":

Fruits{0}.name:           Apple
Fruits{0}.scientificName: Malus domestica
Fruits{1}.name:           Orange
Fruits{1}.scientificName: Citrus X sinensis
Fruits{2}.name:           Pear
Fruits{2}.scientificName: Pyrus 

Each element in the list has a value for each attribute.

Links as Below:

Transformers for Working with List Attributes

What is Spatial Data and Non-Spatial Data?




No comments:

Post a Comment

Stay Connected To Get Free Updates!

Subscribe via Email

You can also receive Free Email Updates:

Widget by NBT